package com.koron.util;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;

public class MyClassLoader extends ClassLoader{
	private URLClassLoader cl;
	
	public MyClassLoader(File classPath) throws MalformedURLException
	{
		URL u = classPath.toURI().toURL();
		cl = URLClassLoader.newInstance(new URL[] { u });
	}
	public Class<?> loadClass(String className) throws ClassNotFoundException {
		return cl.loadClass(className);
	}
	public int hashCode() {
		return cl.hashCode();
	}
	public boolean equals(Object obj) {
		return cl.equals(obj);
	}
	public InputStream getResourceAsStream(String name) {
		return cl.getResourceAsStream(name);
	}
	public void close() throws IOException {
		cl.close();
	}
	public String toString() {
		return cl.toString();
	}
	public URL[] getURLs() {
		return cl.getURLs();
	}
	public URL findResource(String name) {
		return cl.findResource(name);
	}
	public Enumeration<URL> findResources(String name) throws IOException {
		return cl.findResources(name);
	}
	public URL getResource(String name) {
		return cl.getResource(name);
	}
	public Enumeration<URL> getResources(String name) throws IOException {
		return cl.getResources(name);
	}
	public void setDefaultAssertionStatus(boolean enabled) {
		cl.setDefaultAssertionStatus(enabled);
	}
	public void setPackageAssertionStatus(String packageName, boolean enabled) {
		cl.setPackageAssertionStatus(packageName, enabled);
	}
	public void setClassAssertionStatus(String className, boolean enabled) {
		cl.setClassAssertionStatus(className, enabled);
	}
	public void clearAssertionStatus() {
		cl.clearAssertionStatus();
	}
	
}
